package com.rui.patterns.observer;

/**
 * @author : [锐神NO.3]
 * @version : [v1.0]
 * @className : Client
 * @createTime : [2022/2/24 15:43]
 * @description : [描述该类的功能]
 */

public class Client {
    public static void main(String[] args) {
        //创建公共号对象
        SubscriptionSubject subject = new SubscriptionSubject();

        //订阅公众号
        subject.attach(new WeiXinUser("孙悟空"));
        subject.attach(new WeiXinUser("猪悟能"));
        subject.attach(new WeiXinUser("沙悟净"));

        //3.公众号更新,发出消息给订阅者(观察者)对象
        subject.notify("传智黑马的专栏更新了!!!");
    }
}
